package co.edu.unal.unlbs.view.bbean;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;

import co.edu.unal.unlbs.persistence.EAO.IPersonaEAO;
import co.edu.unal.unlbs.persistence.EAO.Impl.PersonaEAO;
import co.edu.unal.unlbs.persistence.entities.Persona;
import co.edu.unal.unlbs.service.PersonCreationService;

@ManagedBean(name="personCreationBBean")
@SessionScoped
public class PersonCreationBBean {
	
	
	@EJB
	IPersonaEAO personaEAO;
	
	private Persona person = new Persona();

	public Persona getPerson() {
		return person;
	}

	public void setPerson(Persona person) {
		this.person = person;
	}

	 public String save(){
		 System.out.println("Se ha entrado a save");
	        this.personaEAO.create(person);
	        System.out.println("Se ha guardado correctamente");
	        return "index";
	    }
	
}
